<?php
//Connect to database
include_once("config.php");

//Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

//Get results from database members
$result = mysql_query("SELECT * FROM members")
or die(mysql_error());

//View results from database members
echo "<table border='1' align=center bgcolor='#CCCCCC'>";
echo "<tr>
                <td>ID</td>
                <td>naam</td>
                <td>bandbreedte</td>
                <td>gebruikers</td>
                <td>authenticatie</td>
                <td>gebruikers</td>
                <td>domein</td>
                <td>groepen</td>
                <td>administratie</td>
                <td>verwijderen</td>
                <td>wijzigen</td>
      </tr>";
//Keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
//Print out the contents of each row into a table
	echo "<tr><td>";
	echo $row['id'];
	echo "</td><td>";
	echo $row['username'];
	echo "</td><td>";
	echo $row['bandbreedte'];
	echo "&nbsp;</td><td>";
	echo $row['gebruikers'];
        echo "</td><td>";
	echo $row['authenticatie'];
        echo "</td><td>";
	echo $row['domein'];
        echo "</td><td>";
	echo $row['groepen'];
        echo "</td><td>";
	echo $row['administratie'];
        echo "</td><td>";
        echo "<td><a href='delete_user.php?id=" . $row['id'] . "'>verwijderen</a></td>";
        echo "<td><a href='view_user.php?id=" . $row['id'] . "'>wijzigen</a></td>";
}

echo "</table>";
?>